package com.cachopoid.db;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;

import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;


public abstract class DBAdapter  {
 
	public Context context;
	public SQLiteDatabase database;
	public DataBaseHelper dbHelper;
 
	public DBAdapter(Context context) {
		this.context = context;
	}
 
	public DBAdapter open() throws SQLException {
		dbHelper = new DataBaseHelper(context);
		database = dbHelper.getWritableDatabase();
		return this;
	}
 
	public void close() {
		dbHelper.close();
	}
 
	
    public abstract boolean insert(Object object);
    public abstract boolean update(int id,Object object);
    public abstract boolean delete(int id);
    public abstract ArrayList listAll(String orderBy);

}

